package com.example.dingdingtools

import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import androidx.appcompat.app.AppCompatActivity
import com.example.tools.CheckPermissionsUtils
import kotlinx.android.synthetic.main.activity_main.*


class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        CheckPermissionsUtils.checkAccessibilityPermission(this)

        button.setOnClickListener(){v ->
            Log.e("TAG", "开启钉钉 自动打卡")
            val intent = Intent(this@MainActivity, MyServic::class.java)
            startService(intent)
        }

        button2.setOnClickListener() { v ->
            Log.e("TAG", "button2")
        }
    }

    override fun onResume() {
        super.onResume()

    }


    override fun onTouchEvent(event: MotionEvent?): Boolean {
        Log.e("TAG", "event: " + event?.x + " .... " + event?.y)
        return super.onTouchEvent(event)
    }

    override fun onPause() {
        super.onPause()
        Log.e("TAG", "onPause")
    }

    override fun onStop() {
        super.onStop()
        Log.e("TAG", "onStop")
    }

    override fun onDestroy() {
        super.onDestroy()
        Log.e("TAG", "onDestroy")
    }
}
